/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Materials;

import Raytracing.Shaders.Shader;
import Raytracing.BRDF.LambertBRDF;
import Raytracing.Shaders.SolidTexture;
import SGGUI.GUIComponent;
import SGGUI.GUIEvent;
import SGGUI.GUIListener;
import SGGUI.SGSlider;
import TweetRay.Exportable;
import Materials.MaterialFactory.Materials;
import TweetRay.UTFWriter;
import processing.core.PVector;

/**
 *
 * @author Matt
 */
public class GlassShader extends SingleColorShader implements Exportable {


    public GlassShader(String name, PVector color) {
        super(name);
        type = Materials.GLASS.ordinal();
        setColor(color);
        SolidTexture texColor = new SolidTexture(color);
        LambertBRDF shad = new LambertBRDF(texColor);

        addBRDF(shad);
        init();
    }
    
    public void pack(UTFWriter output) {

        output.writeBits(Materials.MATTE.ordinal(), 5);
        writeColorBits(output);

    }    
    
    public void GUIEventPerformed(GUIEvent e){
        //I don't understand why I have to do this...
        //but if I don't the caller pretends it can't see calls to the superclass..
        super.GUIEventPerformed(e);
    }
       
}
